Fix deserializing decimal quantities regardless of local culture#911
Conversation
dac9477 to
d360827
Compare
Codecov Report
@@ Coverage Diff @@
## master #911 +/- ##
==========================================
- Coverage 82.70% 82.70% -0.01%
==========================================
Files 291 291
Lines 44040 44034 -6
==========================================
- Hits 36423 36417 -6
Misses 7617 7617
Continue to review full report at Codecov.
|
lipchev
left a comment
There was a problem hiding this comment.
As per the JSON specs the separator is indeed "." (InvariantCulture).
However, given that nobody has complained so far, I would suggest that for v5 we simply replace the Value with the ExtendedValue (i.e. the string representation of the number) and remove the ExtendedValueUnit as it's CLR type could easily be determined from the Unit (once parsed, we can check for the IDecimalQuantity).
|
Great, yes, that sounds reasonable. As for v5, the wishlist is piling up and there are several big ideas for changes that are still up in the air; #714, #709, class vs struct. If you or @tmilnthorp want to start nudging the v5 snowball, I'm happy to help, but work and family has been pretty much consuming all life the past 9 months and it's likely to continue. Baby steps is probably a good idea if we are ever to get any of the breaking changes out the door. |
|
@lipchev forgot to mention you. ☝️ |
Fixes parsing JSON for decimal quantities like Power on machines with cultures like Norwegian, where a comma is decimal separator is used. Several tests were red on my machine, but green on build agent.
Related to #847, #868